-
Notifications
You must be signed in to change notification settings - Fork 121
TargetPlatformHelper.java - Performance & Readability Improvements #2060
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
I assume the build will fail (PDE build is currently not working), so I plan to leave this here and return to it, once PDE build are green again. |
|
|
||
| private static Map<String, String> fgCachedLocations; | ||
| private static Map<ITargetHandle, List<TargetDefinition>> fgCachedTargetDefinitionMap = new HashMap<>(); | ||
| // Use concurrent map to avoid synchronization overhead on read operations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment doesn't match code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
| } | ||
| } | ||
| return list.toArray(new String[list.size()]); | ||
| return Arrays.stream(models) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is highly questionable, as it makes no improvement functionally, and makes debugging impossible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed back
Test Results 745 files - 26 745 suites - 26 47m 32s ⏱️ - 12m 17s For more details on these failures, see this check. Results for commit e4cac57. ± Comparison against base commit f2cc40b. ♻️ This comment has been updated with latest results. |
Optimized regex pattern compilation by precompiling PATTERN_PATH_COLON pattern used in stripPathInformation() method. Simplified switch expression in getTargetVersionString() and improved thread-safety in addTargetDefinitionMap() using computeIfAbsent(). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
f57d3be to
e4cac57
Compare
Optimizations:
improvement in hot paths
much cleaner and more maintainable
simplify logic
Impact: